﻿using UnityEngine;
using System.Collections;

public abstract class Singleton<T> where T : class , new() 
{
    protected static T _Instance;
    protected static object _lock = new object();
    public static T Instance
    {
        get
        {
            lock (_lock)
            {
                if (_Instance == null)
                {
                    _Instance = new T();
                }
                return _Instance;
            }
        }
    }
}
